﻿' Note: For instructions on enabling IIS6 or IIS7 classic mode, 
' visit http://go.microsoft.com/?LinkId=9394802

Public Class MvcApplication
    Inherits System.Web.HttpApplication

    Shared Sub RegisterRoutes(ByVal routes As RouteCollection)
        routes.IgnoreRoute("{resource}.axd/{*pathInfo}")
        routes.MapRoute( _
            "Default", _
            "{controller}/{action}/{id}", _
            New With {.controller = "Home", .action = "Index", .id = ""} _
        )
    End Sub

    Private Sub StartLogger()
        log4net.Config.XmlConfigurator.Configure()
        log4net.Config.BasicConfigurator.Configure()
    End Sub

    Private Sub StartNHibernate()
        Persister.InitialNhibernateLoad(ConfigurationManager.ConnectionStrings("ApplicationServices").ConnectionString, True)
    End Sub

    'Public Sub RegisterViewEngine(ByVal viewEngines As ViewEngineCollection)
    '    viewEngines.Clear()
    '    Dim themeableViewEngine As New Theme
    'End Sub

    Sub Application_Start()
        RegisterRoutes(RouteTable.Routes)
        StartLogger()
        StartNHibernate()
    End Sub
End Class
